// 两个数组的交集、并集、差集
// 不能出现重复项，得到的结果是一个新数组
const arr1 = [33, 22, 22, 55, 33, 11, 33, 5];
const arr2 = [22, 22, 55, 77, 88, 99, 99];

// 并集：两个数组所有的
const  union = Array.from(new Set([...arr1, ...arr2]))
console.log(union)

// 交集：两个数组共有的
const cross = Array.from(new Set(arr1.filter(item => arr2.includes(item))))
console.log(cross)

// 差集：两个数组中，只在自己数组中存在的
const diff = Array.from(new Set(union.filter(item => !cross.includes(item))))
console.log(diff)